package com.tank.decoration;

import com.tank.entrity.GameObject;
import java.awt.*;

/**
 * 子弹的尾巴
 */
public class TailDecorator extends GameDecorator {

    public TailDecorator(GameObject gameObject) {
        super(gameObject);
    }

    @Override
    public void paint(Graphics graphics) {
        super.paint(graphics);
        this.x = super.getGameObject().x;
        this.y = super.getGameObject().y;
        Color color = graphics.getColor();
        graphics.setColor(Color.GREEN);
        graphics.drawLine(((int) this.x + 5), (int) this.y, (int) this.x  + 5, (int) this.y - 10);
        graphics.setColor(color);
    }

    @Override
    public int getWidth() {
        return super.getGameObject().getWidth();
    }

    @Override
    public int getHeight() {
        return super.getGameObject().getHeight();
    }
}
